import { getRequest, postRequest, putRequest, patchRequest, deleteRequest } from './util/requestAlias';
import { buildURL, buildRequestBody } from './util/requestHandler';
import {
{{#modelImports}}  {{this}},
{{/modelImports}}
} from './models';

{{#operations}}
{{#operation}}
interface {{operationIdCamelCase}}Params {
{{#allParams}}
{{#description}}
  /**
   * {{{description}}}
   */
{{/description}}
  {{paramName}}{{^required}}?{{/required}}: {{{dataType}}};
{{/allParams}}
}

{{/operation}}

{{#operation}}
/**
{{#summary}}
 * {{summary}}
{{/summary}}
 *
{{#notes}}
 * {{notes}}
{{/notes}}
 */
export const {{nickname}} = ({{#hasParams}}params: {{operationIdCamelCase}}Params{{/hasParams}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> =>
  {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}Request(
    buildURL(
      '{{path}}',
      {{#hasParams}}params{{/hasParams}}{{^hasParams}}{}{{/hasParams}},
      {{#hasQueryParams}}[ {{#queryParams}}'{{baseName}}', {{/queryParams}}],{{/hasQueryParams}}
    ),
    {{#hasBodyParam}}
    buildRequestBody(
      params,
      [// todo],
    ),
    {{/hasBodyParam}}
  );

{{/operation}}

{{/operations}}
